/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Control;

import Acquaintance.IAPlace;
import DALFactory.IDALFactory;
import DALFactory.IDataMapper2;
import DALFactory.IRouteMapper;
import net.sf.json.JSONObject;

/**
 * 
 * @author Administrator
 */
public class CRoute {

	public boolean exiRoute(String ID) {
		IDALFactory factory = CCache.getCache().getDALFactory();
		IRouteMapper routeMapper = factory.CreateRouteMapper();
		return routeMapper.exiRouteByID(ID);
	}

	public IAPlace getPlace(String ID) {
		IDALFactory idf = CCache.getCache().getDALFactory();
		IDataMapper2 dm = idf.CreateDataMapper2();
		return dm.getPlaceByID(ID);
	}

	public boolean exiPlace(String ID) {
		IDALFactory idf = CCache.getCache().getDALFactory();
		IDataMapper2 dm = idf.CreateDataMapper2();
		return dm.exiPlaceByID(ID);
	}

	public JSONObject getRouet(String ID) {
		IDALFactory factory = CCache.getCache().getDALFactory();
		IRouteMapper routeMapper = factory.CreateRouteMapper();
		return routeMapper.getRouteByID(ID);
	}
}
